﻿using System;

namespace WhileUsage
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Please input numbers count");

            Console.Write("n: ");
            int n = int.Parse(Console.ReadLine());

            Console.WriteLine("-----------");

            int sum = 0;
            int i = 1;
            int current;

            while (i <= n)
            {
                Console.Write($"{i}. > ");
                current = int.Parse(Console.ReadLine());
                if(current > 1 && current <= 1000 && current % 2 == 0)
                {
                    sum += current;
                    i++;
                }
                else
                {
                    Console.WriteLine("Number is not allowed. Please try again");
                }
            }

            Console.WriteLine("-----------");

            string message = $"Sum: {sum}";

            Console.WriteLine(message);

            Console.ReadKey();
        }
    }
}
